<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Design by Free CSS Templates
http://www.freecsstemplates.org
Released for free under a Creative Commons Attribution 2.5 License

Name       : Leaf Brush 
Description: A two-column, fixed-width design for 1024x768 screen resolutions.
Version    : 1.0
Released   : 20100130

-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>ALarm System</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="style1.css" rel="stylesheet" type="text/css" media="screen" />
<script type="text/javascript" src="js/prototype-1.6.0.2.js"></script>
</head>
<script language="JavaScript" type="text/JavaScript">
	var _usr = "";
	var _pwd = "";

	function getLogin(){

		_usr = document.getElementById("username").value;	
		if(_usr.length == 0){alert("กรุณาระบุ e-mail!");return false;}
		_pwd = document.getElementById("password").value;
		if(_pwd.length == 0){alert("กรุณาระบุ password!");return false;}
		_usr = _usr + '@ttt.co.th';
        var session = Math.random();
        new Ajax.Request(
        "connldap.php?session=" + session +'&_usr=' + _usr + '&_pwd=' + _pwd,			// url
        { asynchronous: true,			// default is true
            method: "get",				// default is post
            onSuccess: function(request) {
                reGetLogin(request.responseText);
            }
        });	
        waiting.innerHTML = '<img src="images/loading1.gif"/> <span class="required">process...</span>';        			
        
	}
	
	function reGetLogin(txt){			
		//var ret = 1;
		var oRE = /<return>(.*)<\/return>/gi;		
		//alert(txt);
		oRE.test(txt);		
		var ret = RegExp["$1"];		
		//alert(txtr);
		if(ret == 1){			
			window.location.href = "malarm.php";
		}else{
			alert("รหัสไม่ถูกต้อง กรุณา ล็อกอินใหม่...");
		}
		waiting.innerHTML = '';        				
	}
</script>
<body>
<div id="header">
  <hr />
	<!-- end #logo -->
</div>
<!-- end #header -->
<!-- end #header-wrapper -->
<div id="wrapper">
	<div id="wrapper-bgtop">
		<div id="wrapper-bgbtm">
			<div id="page">
				<div id="content" align="center">
					<div class="post">						
						<h2 class="title"><a href="#">Web Management System ALarm </a></h2>
						<em hid> Please enter your login name and password used same to e-mail.  </em>
						<div class="entry" >
							<table width="400" border="0" cellpadding="5" cellspacing="8" class="bordertable">
                              <tr>
                                <td width="40%" align="right" class="line_dash">Username : </td>
                                <td align="left" class="line_dash">
                                
                                    <input id="username" type="text" class="textBox_login" size="15" />
                                    @ttt.co.th<img src="images/001_57.gif" alt="" width="24" height="24" /></td>
                              </tr>
                              <tr>
                                <td align="right" class="line_dash">Password : </td>
                                <td align="left" class="line_dash">
                                    <input id="password" type="password" class="textBox_login" size="15" />
                                    <img src="images/001_41.gif" alt="" width="24" height="24" />                                </td>
                              </tr>
                              <tr>
                                <td align="right">&nbsp;</td>
                                <td align="left"><img src="images/sign-in.png" alt="" width="64" height="22" onclick="getLogin()"></td>
                              </tr>
                            </table>
							<p><div id="waiting"></div></p>
					  </div>
					</div>
			  </div>
				<!-- end #content -->
				
				<!-- end #sidebar -->
            </div>
			<!-- end #page -->
			<div style="clear: both;" align="center" class="formcolumn">
				Copyright &copy; 2009  บริษัท ทีทีแอนด์ที จำกัด(มหาชน) ภาคตะวันออกเฉียงเหนือนตอนล่าง <br />
				278 หมู่ 2 ถ. ราชสีมา - โชคชัย ต.หนองบัวศาลา อ.เมือง จ.นครราชสีมา 30000  โทร 044-334801.
		  </div>
		</div>
	</div>
</div>

</body>
</html>
